package com.project.finance.verify.controller;

import com.project.finance.common.po.TbVerify;
import com.project.finance.common.resultconfig.Result;
import com.project.finance.common.resultconfig.ResultGenerator;
import com.project.finance.common.vo.ResultMsg;
import com.project.finance.verify.service.VerifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api")
public class VerifyController {
    @Autowired
    private VerifyService verifyService;

//    查询所有用户的实名认证信息
//    @RequestMapping(value = "/verify" ,method = RequestMethod.GET)
//    public Result selectAll(){
//        List<TbVerify> tbVerifies = verifyService.selectAll();
//        return ResultGenerator.apiSuccess(tbVerifies);
//    }
    //分页
    @RequestMapping(value = "verify",method = RequestMethod.GET)
    public ResultMsg listVerifyByPageCondition(@RequestParam("pageSize")int pageSize,
                                               @RequestParam("pageNum")int pageNum){
        ResultMsg resultMsg = verifyService.listVerifyByPage(pageSize, pageNum);
        resultMsg.setCode(0);
        return resultMsg;
    }

}
